Skip to content

Fix ConcatReader.close() to close all readers on failure#490

Merged
SuperMonster003 merged 1 commit intoSuperMonster003:masterfrom
iamsanjaymalakar:master
Mar 14, 2026
Merged

Fix ConcatReader.close() to close all readers on failure#490
SuperMonster003 merged 1 commit intoSuperMonster003:masterfrom
iamsanjaymalakar:master

Conversation

@iamsanjaymalakar
Copy link
Contributor

This PR makes ConcatReader.close() exception-safe in both com.stardust.io.ConcatReader and org.autojs.autojs.io.ConcatReader.

Problem
If closing one underlying Reader throws an IOException, close() exits early and the remaining readers are never closed.

Fix
Close all readers in the queue, collect the first IOException, suppress subsequent close failures, and throw after cleanup is complete.

@SuperMonster003 SuperMonster003 merged commit f6cbb41 into SuperMonster003:master Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants